package com.tbit.uqbike.webmanager.business.operationreport.controller;

import com.tbit.common.entity.view.PageResult;
import com.tbit.common.entity.view.Result;
import com.tbit.common.entity.vo.*;
import com.tbit.uqbike.webmanager.business.operationreport.service.OperationReportNewService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

/**
 * 运营报表-新
 *
 * @author: qiu.longjie
 * @create: 2025-05-08
 */
@RestController
@RequestMapping("/operationReport")
public class OperationReportNewController {

    @Autowired
    private OperationReportNewService operationReportNewService;

    /**
     * 获取运营报表数据
     *
     * @param vo
     * @return
     */
    @GetMapping("/get")
    public Result<OperationReportRespBoxVo> get(@Validated OperationReportReqVo vo) {
        return Result.success(operationReportNewService.getDataBox(vo));
    }

    /**
     * 获取运营报表数据-列表
     *
     * @param vo
     * @return
     */
    @GetMapping("/list")
    public Result<PageResult<OperationReportListRespVo>> list(@Validated OperationReportListReqVo vo) {
        return Result.success(operationReportNewService.listData(vo));
    }

    /**
     * 导出运营报表数据
     *
     * @param vo 查询条件
     * @return excel
     */
    @PostMapping("/list/export")
    public Result<Object> exportData(@Validated OperationReportListReqBaseVo vo) {
        return operationReportNewService.exportData(vo);
    }
}
